<?php /*a:3:{s:68:"D:\phpstudy_pro\WWW\mrht5.3\application\admin\view\app\queryapp.html";i:1648551066;s:72:"D:\phpstudy_pro\WWW\mrht5.3\application\admin\view\..\common\header.html";i:1648824522;s:72:"D:\phpstudy_pro\WWW\mrht5.3\application\admin\view\..\common\footer.html";i:1648824522;}*/ ?>

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="keywords" content="LightYear,LightYearAdmin,光年,后台模板,后台管理系统,光年HTML模板">
    <meta name="description" content="Light Year Admin V4是一个基于Bootstrap v4.4.1的后台管理系统的HTML模板。">
    <meta name="author" content="yinq">
    <title>后台管理</title>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <link rel="stylesheet" type="text/css" href="/static/css/materialdesignicons.min.css">
    <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/static/css/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/static/css/style.min.css">
    <link rel="stylesheet" type="text/css" href="/static/js/jquery-confirm/jquery-confirm.min.css">
    <link rel="stylesheet" type="text/css" href="/static/js/bootstrap-datepicker/bootstrap-datepicker3.min.css">
    <link rel="stylesheet" type="text/css" href="/static/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css">
    <link rel="stylesheet" type="text/css" href="/static/js/bootstrap-clockpicker/bootstrap-clockpicker.min.css">
</head>

<body>

<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <aside class="lyear-layout-sidebar">

            <!-- logo -->
            <div id="logo" class="sidebar-header">
                <a><h1>后台管理</h1></a>
            </div>
            <div class="lyear-layout-sidebar-info lyear-scroll">

                <nav class="sidebar-main">
                    <ul class="nav-drawer">
                        <li class="nav-item active"> <a href="<?php echo url('/admin/index'); ?>"><i class="mdi mdi-home"></i> <span>后台首页</span></a> </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-android"></i> <span>应用管理</span></a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('/admin/app/index'); ?>">应用管理</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-account"></i> <span>用户管理</span></a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('/admin/user/index'); ?>">用户管理</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-credit-card"></i> <span>卡密管理</span></a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('/admin/km/index'); ?>">卡密管理</a> </li>
                                <li> <a href="<?php echo url('/admin/km/addkm'); ?>">添加卡密</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-clipboard-text"></i> <span>笔记管理</span></a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('/admin/notes/index'); ?>" >笔记管理</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-email"></i> <span>邮箱管理</span></a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('/admin/email/index'); ?>">邮箱配置</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-shopping"></i> <span>商城管理</span></a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('/admin/shop/index'); ?>">商品管理</a> </li>
                                <li> <a href="<?php echo url('/admin/shop/shoporder'); ?>">订单管理</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-table-large"></i> <span>论坛管理</span></a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('/admin/bbs/plate'); ?>">板块管理</a> </li>
                                <li> <a href="<?php echo url('/admin/bbs/platepost'); ?>">帖子管理</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-file"></i> <span>附件管理</span></a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('/admin/file/index'); ?>">附件管理</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="https://console-docs.apipost.cn/cover.html?url=7266fb844b51c347&salt=084dbf39b3fe620d" target="_blank"><i class="mdi mdi-file-document"></i> <span>接口文档</span></a>
                        </li>
                    </ul>
                </nav>

                <div class="sidebar-footer">
                    <p class="copyright">Copyright &copy; 2022. <a target="_blank" href="http://www.moranblog.cn">默然iapp后台管理系统</a> All rights reserved.</p>
                </div>

            </div>
        </aside>
        <!--End 左侧导航-->

        <!--头部信息-->
        <header class="lyear-layout-header">

            <nav class="navbar">

                <div class="navbar-left">
                    <div class="lyear-aside-toggler">
                        <span class="lyear-toggler-bar"></span>
                        <span class="lyear-toggler-bar"></span>
                        <span class="lyear-toggler-bar"></span>
                    </div>
                </div>

                <ul class="navbar-right d-flex align-items-center">
                    <li class="dropdown dropdown-notice">
            <span data-toggle="dropdown" class="icon-item">
              <i class="mdi mdi-bell-outline"></i>
              <span class="badge badge-danger">10</span>
            </span>
<!--                        <div class="dropdown-menu dropdown-menu-right">-->
<!--                            <div class="lyear-notifications">-->
<!--                                <div class="lyear-notifications-title clearfix"  data-stopPropagation="true"><a href="#!" class="float-right">查看全部</a>你有 10 条未读消息</div>-->
<!--                                <div class="lyear-notifications-info lyear-scroll">-->
<!--                                    <a href="#!" class="dropdown-item" title="树莓派销量猛增，疫情期间居家工作学习、医疗领域都需要它">树莓派销量猛增，疫情期间居家工作学习、医疗领域都需要它</a>-->
<!--                                </div>-->
<!--                            </div>-->
<!--                        </div>-->
                    </li>
                    <!--切换主题配色-->
                    <li class="dropdown dropdown-skin">
                        <span data-toggle="dropdown" class="icon-item"><i class="mdi mdi-palette"></i></span>
                        <ul class="dropdown-menu dropdown-menu-right" data-stopPropagation="true">
                            <li class="drop-title"><p>主题</p></li>
                            <li class="drop-skin-li clearfix">
                <span class="inverse">
                  <input type="radio" name="site_theme" value="default" id="site_theme_1" checked>
                  <label for="site_theme_1"></label>
                </span>
                                <span>
                  <input type="radio" name="site_theme" value="dark" id="site_theme_2">
                  <label for="site_theme_2"></label>
                </span>
                                <span>
                  <input type="radio" name="site_theme" value="translucent" id="site_theme_3">
                  <label for="site_theme_3"></label>
                </span>
                            </li>
                            <li class="drop-title"><p>LOGO</p></li>
                            <li class="drop-skin-li clearfix">
                <span class="inverse">
                  <input type="radio" name="logo_bg" value="default" id="logo_bg_1" checked>
                  <label for="logo_bg_1"></label>
                </span>
                                <span>
                  <input type="radio" name="logo_bg" value="color_2" id="logo_bg_2">
                  <label for="logo_bg_2"></label>
                </span>
                                <span>
                  <input type="radio" name="logo_bg" value="color_3" id="logo_bg_3">
                  <label for="logo_bg_3"></label>
                </span>
                                <span>
                  <input type="radio" name="logo_bg" value="color_4" id="logo_bg_4">
                  <label for="logo_bg_4"></label>
                </span>
                                <span>
                  <input type="radio" name="logo_bg" value="color_5" id="logo_bg_5">
                  <label for="logo_bg_5"></label>
                </span>
                                <span>
                  <input type="radio" name="logo_bg" value="color_6" id="logo_bg_6">
                  <label for="logo_bg_6"></label>
                </span>
                                <span>
                  <input type="radio" name="logo_bg" value="color_7" id="logo_bg_7">
                  <label for="logo_bg_7"></label>
                </span>
                                <span>
                  <input type="radio" name="logo_bg" value="color_8" id="logo_bg_8">
                  <label for="logo_bg_8"></label>
                </span>
                            </li>
                            <li class="drop-title"><p>头部</p></li>
                            <li class="drop-skin-li clearfix">
                <span class="inverse">
                  <input type="radio" name="header_bg" value="default" id="header_bg_1" checked>
                  <label for="header_bg_1"></label>                      
                </span>
                                <span>
                  <input type="radio" name="header_bg" value="color_2" id="header_bg_2">
                  <label for="header_bg_2"></label>                      
                </span>
                                <span>
                  <input type="radio" name="header_bg" value="color_3" id="header_bg_3">
                  <label for="header_bg_3"></label>
                </span>
                                <span>
                  <input type="radio" name="header_bg" value="color_4" id="header_bg_4">
                  <label for="header_bg_4"></label>                      
                </span>
                                <span>
                  <input type="radio" name="header_bg" value="color_5" id="header_bg_5">
                  <label for="header_bg_5"></label>                      
                </span>
                                <span>
                  <input type="radio" name="header_bg" value="color_6" id="header_bg_6">
                  <label for="header_bg_6"></label>                      
                </span>
                                <span>
                  <input type="radio" name="header_bg" value="color_7" id="header_bg_7">
                  <label for="header_bg_7"></label>
                </span>
                                <span>
                  <input type="radio" name="header_bg" value="color_8" id="header_bg_8">
                  <label for="header_bg_8"></label>
                </span>
                            </li>
                            <li class="drop-title"><p>侧边栏</p></li>
                            <li class="drop-skin-li clearfix">
                <span class="inverse">
                  <input type="radio" name="sidebar_bg" value="default" id="sidebar_bg_1" checked>
                  <label for="sidebar_bg_1"></label>
                </span>
                                <span>
                  <input type="radio" name="sidebar_bg" value="color_2" id="sidebar_bg_2">
                  <label for="sidebar_bg_2"></label>
                </span>
                                <span>
                  <input type="radio" name="sidebar_bg" value="color_3" id="sidebar_bg_3">
                  <label for="sidebar_bg_3"></label>
                </span>
                                <span>
                  <input type="radio" name="sidebar_bg" value="color_4" id="sidebar_bg_4">
                  <label for="sidebar_bg_4"></label>
                </span>
                                <span>
                  <input type="radio" name="sidebar_bg" value="color_5" id="sidebar_bg_5">
                  <label for="sidebar_bg_5"></label>
                </span>
                                <span>
                  <input type="radio" name="sidebar_bg" value="color_6" id="sidebar_bg_6">
                  <label for="sidebar_bg_6"></label>
                </span>
                                <span>
                  <input type="radio" name="sidebar_bg" value="color_7" id="sidebar_bg_7">
                  <label for="sidebar_bg_7"></label>
                </span>
                                <span>
                  <input type="radio" name="sidebar_bg" value="color_8" id="sidebar_bg_8">
                  <label for="sidebar_bg_8"></label>
                </span>
                            </li>
                        </ul>
                    </li>
                    <!--切换主题配色-->
                    <li class="dropdown dropdown-profile">
                        <a href="javascript:void(0)" data-toggle="dropdown" class="dropdown-toggle">
                            <img id="adminnewtx" class="img-avatar img-avatar-48 m-r-10" src="http://q1.qlogo.cn/g?b=qq&nk=<?php echo htmlentities(app('session')->get('adminqq')); ?>&s=640" />
                            <span id="adminnewname"><?php echo htmlentities(app('session')->get('adminname')); ?></span>
                        </a>
                        <ul class="dropdown-menu dropdown-menu-right">
                            <li>
                                <a class="dropdown-item" href="<?php echo url('/admin/admin/admininfo'); ?>"><i class="mdi mdi-account"></i> 个人信息</a>
                            </li>
                            <li>
                                <a class="dropdown-item" href="<?php echo url('/admin/admin/changepwd'); ?>"><i class="mdi mdi-lock-outline"></i> 修改密码</a>
                            </li>
                            <li>
                                <a class="dropdown-item" href="javascript:void(0)" onclick="Clear_All()" ><i class="mdi mdi-delete"></i> 清空缓存</a>
                            </li>
                            <li class="dropdown-divider"></li>
                            <li>
                                <a class="dropdown-item" onclick="loginout()" href="javascript:void(0)"><i class="mdi mdi-logout-variant"></i> 退出登录</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </nav>
        </header>
        <!--End 头部信息-->

<!--页面主要内容-->
<main class="lyear-layout-content">

    <div class="container-fluid p-t-15">

        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">
                        <form action="<?php echo url('/admin/app/queryapp'); ?>" method="post">
                        <div class="form-group" >
                            <label for="appid">应用id</label>
                            <input type="text" class="form-control" id="appid" value="<?php echo htmlentities($app['appid']); ?>" disabled>
                        </div>
                        <div class="form-group">
                            <label for="appname">应用名称</label>
                            <input type="text" class="form-control" id="appname" value="<?php echo htmlentities($app['appname']); ?>" placeholder="请输入应用名称">
                        </div>
                            <div class="form-group file-group">
                                <label for="appicon">应用图标</label>
                                <div class="input-group">
                                    <input type="text" id="appicon" class="form-control file-value" name="web_site_logo" value="<?php echo htmlentities($app['appicon']); ?>" placeholder="应用图标">
                                    <input type="file" accaccept=".png,.jpg,.jpeg,.bmp,.gif" style="display: none">
                                    <div class="input-group-btn">
                                        <button class="btn btn-default file-browser" type="button">上传图片</button>
                                    </div>
                                </div>
                            </div>

                        <div class="form-group">
                            <label for="introduction">应用简介</label>
                            <input type="text" class="form-control" id="introduction" value="<?php echo htmlentities($app['introduction']); ?>" placeholder="请输入应用简介">
                        </div>
                        <div class="form-group">
                            <label for="author">开发者联系QQ</label>
                            <input type="text" class="form-control" id="author" value="<?php echo htmlentities($app['author']); ?>" placeholder="请输入开发者联系QQ">
                        </div>
                        <div class="form-group">
                            <label for="group">官方群组</label>
                            <input type="text" class="form-control" id="group" value="<?php echo htmlentities($app['group']); ?>" placeholder="请输入官方群组">
                        </div>
                        <div class="form-group">
                            <label for="title">公告标题</label>
                            <input type="text" class="form-control" id="title" value="<?php echo htmlentities($app['title']); ?>" placeholder="请输入公告标题">
                        </div>
                        <div class="form-group">
                            <label for="content">公告内容</label>
                            <input type="text" class="form-control" id="content" value="<?php echo htmlentities($app['content']); ?>" placeholder="请输入公告内容">
                        </div>
                        <div class="form-group">
                            <label for="version">版本号</label>
                            <input type="text" class="form-control" id="version" value="<?php echo htmlentities($app['version']); ?>" placeholder="请输入版本号">
                        </div>
                        <div class="form-group">
                            <label for="updatecontent">更新内容</label>
                            <input type="text" class="form-control" id="updatecontent" value="<?php echo htmlentities($app['updatecontent']); ?>" placeholder="请输入更新内容">
                        </div>
                        <div class="form-group">
                            <label for="download">下载地址</label>
                            <input type="text" class="form-control" id="download" value="<?php echo htmlentities($app['download']); ?>" placeholder="请输入下载地址">
                        </div>
                        <div class="form-group" >
                             <label for="hierarchy">等级划分</label>
                             <textarea class="form-control" aria-label="With textarea" id="hierarchy" placeholder="必须按照给的格式输入" style="height: 200px;"><?php echo htmlentities($app['hierarchy']); ?></textarea>
                        </div>
                        <div class="form-group">
                            <label for="zcmoney">注册赠送金币</label>
                            <input type="number" class="form-control" id="zcmoney" value="<?php echo htmlentities($app['zcmoney']); ?>" placeholder="请输入注册赠送金币">
                        </div>
                        <div class="form-group">
                            <label for="zcexp">注册赠送经验</label>
                            <input type="number" class="form-control" id="zcexp" value="<?php echo htmlentities($app['zcexp']); ?>" placeholder="请输入注册赠送经验">
                        </div>
                        <div class="form-group">
                            <label for="zcvip">注册赠送会员天数</label>
                            <input type="number" class="form-control" id="zcvip" value="<?php echo htmlentities($app['zcvip']); ?>" placeholder="请输入注册赠送会员天数">
                        </div>
                        <div class="form-group">
                            <label for="signmoney">签到赠送金币</label>
                            <input type="number" class="form-control" id="signmoney" value="<?php echo htmlentities($app['signmoney']); ?>" placeholder="请输入签到赠送金币">
                        </div>
                        <div class="form-group">
                            <label for="signexp">签到赠送经验</label>
                            <input type="number" class="form-control" id="signexp" value="<?php echo htmlentities($app['signexp']); ?>" placeholder="请输入签到赠送经验">
                        </div>
                            <div class="form-group">
                                <label for="signvip">签到赠送会员天数</label>
                                <input type="number" class="form-control" id="signvip" value="<?php echo htmlentities($app['signvip']); ?>" placeholder="请输入签到赠送会员天数">
                            </div>
                        <div class="form-group">
                            <label for="postmoney">发帖赠送金币</label>
                            <input type="number" class="form-control" id="postmoney" value="<?php echo htmlentities($app['postmoney']); ?>" placeholder="请输入发帖赠送金币数量">
                        </div>
                            <div class="form-group">
                                <label for="postexp">发帖赠送经验</label>
                                <input type="number" class="form-control" id="postexp" value="<?php echo htmlentities($app['postexp']); ?>" placeholder="请输入发帖赠送经验">
                            </div>
                            <div class="form-group">
                                <label for="commentmoney">评论赠送金币</label>
                                <input type="number" class="form-control" id="commentmoney" value="<?php echo htmlentities($app['commentmoney']); ?>" placeholder="请输入评论赠送金币数量">
                            </div>
                            <div class="form-group">
                                <label for="commentexp">评论赠送经验</label>
                                <input type="number" class="form-control" id="commentexp" value="<?php echo htmlentities($app['commentexp']); ?>" placeholder="请输入评论赠送经验">
                            </div>

                            <div class="form-group">
                                <label>是否开启注册验证码</label>
                                    <select class="form-control" id="is_email">
                                        <?php if($app['is_email'] == 'true'): ?> <option value="true" selected>是</option><option value="false">否</option>
                                        <?php else: ?><option value="true" >是</option><option value="false" selected>否</option>
                                        <?php endif; ?>
                                    </select>
                            </div>
                            <div class="form-group">
                                <label>app开关</label>
                                <div class="custom-control custom-switch">
                                    <input type="checkbox" class="custom-control-input" id="app_site_status" checked="">
                                    <label class="custom-control-label" for="app_site_status"></label>
                                </div>
                                <small class="help-block">app关闭后将不能访问，可正常登录,但不能登录注册</small>
                            </div>

                        <button type="button" onclick="updateapp()" class="btn btn-primary mb-2">提交</button>
                        <button type="button" class="btn btn-default mb-2" onclick="javascript:history.back(-1);return false;">返 回
                        </button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>
<!--End 页面主要内容-->
</div>
</div>
<style>
    .imgPreview {
        display: none;
        top: 0;
        left: 0;
        width: 100%; /*容器占满整个屏幕*/
        height: 100%;
        position: fixed;
        background: rgba(0, 0, 0, 0.5);
    }

    .imgPreview img {
        z-index: 50;
        width: 40%;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
    }
</style>
<div class="imgPreview">
    <img src="#" alt="" id="imgPreview">
</div>
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/js/popper.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="/static/js/jquery.cookie.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-confirm/jquery-confirm.min.js"></script>
<script type="text/javascript" src="/static/js/main.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap-notify.min.js"></script>
<!--图标插件-->
<script type="text/javascript" src="/static/js/Chart.min.js"></script>
<!--loding插件-->
<script type="text/javascript" src="/static/js/lyear-loading.js"></script>
<!--时间日期选择器-->
<script type="text/javascript" src="/static/js/momentjs/moment.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="/static/js/momentjs/locale/zh-cn.min.js"></script>
<script type="text/javascript">
    //清除所有缓存
    function Clear_All(obj) {
        $.ajax({
            type:'get',
            url:"<?php echo url('/admin/admin/clear_all'); ?>",
            data: {},
            dataType: "json",
            success:function (data){
                $.alert({
                    title: '成功提示',
                    icon: 'mdi mdi-alert',
                    type: 'green',
                    content: data.msg
                });
            }
        })
    }

    function loginout() {
        $.ajax({
            type:'get',
            url:"<?php echo url('/admin/admin/loginout'); ?>",
            data: {},
            dataType: "json",
            success:function (data){
                location.reload();
            }
        })
    }
        $(function () {
        $('.imgurl').on('click', function () {
            var src = $(this).attr('src');
            $('.imgPreview img').attr('src', src);
            $('.imgPreview').show()
        });
        $('.imgPreview').on('click', function () {
        $('.imgPreview').hide()
    });
    })

</script>
<script>
document.getElementById("app_site_status").checked = <?php echo htmlentities($app['app_site_status']); ?>;
function updateapp(){
    var l = $('body').lyearloading({
        opacity: 0.2,
        spinnerSize: 'lg',
        spinnerText: '后台处理中，请稍后...',
        textColorClass: 'text-info',
        spinnerColorClass: 'text-info'
    });
    var appid = $.trim($("#appid").val());
    var appname = $.trim($("#appname").val());
    var appicon = $.trim($("#appicon").val());
    var introduction = $.trim($("#introduction").val());
    var author = $.trim($("#author").val());
    var group = $.trim($("#group").val());
    var title = $.trim($("#title").val());
    var content = $.trim($("#content").val());
    var version = $.trim($("#version").val());
    var updatecontent = $.trim($("#updatecontent").val());
    var download = $.trim($("#download").val());
    var zcmoney = $.trim($("#zcmoney").val());
    var zcexp = $.trim($("#zcexp").val());
    var zcvip = $.trim($("#zcvip").val());
    var signmoney = $.trim($("#zcvip").val());
    var signexp = $.trim($("#signexp").val());
    var signvip = $.trim($("#signvip").val());
    var postmoney = $.trim($("#postmoney").val());
    var postexp = $.trim($("#postexp").val());
    var commentmoney = $.trim($("#commentmoney").val());
    var commentexp = $.trim($("#commentexp").val());
    var is_email = $.trim($("#is_email").val());
    var hierarchy = $.trim($("#hierarchy").val());
    var app_site_status = document.getElementById("app_site_status").checked
    $.ajax({
        type: "POST",
        url: "<?php echo url('/admin/app/updateapp'); ?>",
        data: {
            appid: appid,
            appname: appname,
            appicon: appicon,
            introduction: introduction,
            author: author,
            group: group,
            title:title,
            content: content,
            version: version,
            updatecontent: updatecontent,
            download: download,
            zcmoney: zcmoney,
            zcexp: zcexp,
            zcvip: zcvip,
            signexp: signexp,
            signvip: signvip,
            signmoney:signmoney,
            postmoney:postmoney,
            postexp:postexp,
            commentmoney:commentmoney,
            commentexp:commentexp,
            is_email:is_email,
            app_site_status: app_site_status,
            hierarchy:hierarchy,
        },
        dataType: "json",
        success: function (data) {
            setTimeout(function() {
                l.destroy();
            }, 1e3)
            if (data.code == 200){
                $.notify({
                    message: data.msg
                },{
                    placement: {
                        from: "top",
                        align: "center"
                    },
                    type: 'success'
                });
            }else{
                $.notify({
                    message: data.msg
                },{
                    placement: {
                        from: "top",
                        align: "center"
                    },
                    // settings
                    type: 'danger'
                });
            }
        }
    })
}

$(document).ready(function() {
    $(document).on('click', '.file-browser', function() {
        var $browser = $(this);
        var file = $browser.closest('.file-group').find('[type="file"]');
        file.on( 'click', function(e) {
            e.stopPropagation();
        });
        file.trigger('click');
    });

    $(document).on('change', '.file-group [type="file"]', function() {
        var l = $('body').lyearloading({
            opacity: 0.2,
            spinnerSize: 'lg',
            spinnerText: '后台处理中，请稍后...',
            textColorClass: 'text-info',
            spinnerColorClass: 'text-info'
        });
        var $this    = $(this);
        var $input   = $(this)[0];
        var $len     = $input.files.length;
        var formFile = new FormData();

        if ($len == 0) {
            return false;
        } else {
            var fileAccaccept = $this.attr('accaccept');
            var fileType      = $input.files[0].type;
            var type          = (fileType.substr(fileType.lastIndexOf("/") + 1)).toLowerCase();

            if (!type || fileAccaccept.indexOf(type) == -1) {
                $.notify({
                    message: '您上传图片的类型不符合(.jpg|.jpeg|.gif|.png|.bmp)',
                },{
                    placement: {
                        from: "top",
                        align: "center"
                    },
                    type: 'success'
                });
                l.destroy();
                return false;
            }
            formFile.append("file", $input.files[0]);
        }

        var data = formFile;

        $.ajax({
            url: "<?php echo url('/admin/app/upload'); ?>",
            data: data,
            type: "POST",
            dataType: "json",
            //上传文件无需缓存
            cache: false,
            //用于对data参数进行序列化处理 这里必须false
            processData: false,
            //必须
            contentType: false,
            success: function (res) {
                setTimeout(function() {
                    l.destroy();
                }, 1e3)
                if (res.code == 200) {
                    $.notify({
                        message: res.msg
                    },{
                        placement: {
                            from: "top",
                            align: "center"
                        },
                        type: 'success'
                    });
                    //console.log(res.data[0].filePath);
                    $this.closest('.file-group').find('.file-value').val(res.data[0].fullPath);
                } else {
                    $.notify({
                        message: "系统错误"
                    },{
                        placement: {
                            from: "top",
                            align: "center"
                        },
                        // settings
                        type: 'danger'
                    });
                }
            },
        });
    });
});
</script>

</body>

</html>
